home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 July & August
/
rerun-1986-07-08.d64
/
mag printer
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
71 lines
1 rem mag printer v3.4
2 rem (c) 1986 david a. hook
10 a$="abcdefghijklmnopqrst": a$=a$+a$
30 rem issue file name
40 read f$
60 print "[147]"; tab(12); "[205][193][199][193][218][201][206][197] [208][210][201][206][212][197][210]"
70 print tab(9); "(c) 1986 [196]avid [193]. [200]ook"
80 print" [211]end the [205]agazine [201]ssue to a [208]rinter or the [211]creen."
90 print " [207]nce started, [208]ause by striking a key"
100 print " [210]esume/[209]uit by striking another key."
120 lp=25: pp=66: ad=896: if peek(ad)-160 then gosub 1000: rem read data
140 print ""; tab(16); f$
150 input "[145][206]ame of issue:"; f$
170 dv=4: input "[208]rinter [196]evice #: 4[157][157][157]"; dv
180 if dv<3 or dv>5 goto 170
190 if dv=3 goto 230
210 sa=0: input "[211]econdary [193]ddress (lower case): 7[157][157][157]"; sa
230 open 15, 8, 15, "i0"
250 rem get total line count
260 open 2, 8, 2, f$
270 sys ad
280 ln=val(a$)-1: pg=ln/lp
290 close 2
300 if ln<1 or pg<>int(pg) then print "file error": close 15: stop
320 input "[198]irst [208]age to print: 1[157][157][157]"; p$
330 pf=int(val(p$)): if pf<1 then pf=1
340 if pf>pg then pf=pg
350 fl=(pf-1)*lp + 2
370 print tab(21); pg
380 input "[145][198]inal [208]age to print:"; p$
390 pl=int(val(p$)): if pl<1 then pl=1
400 if pl>pg then pl=pg
410 if pl<pf then pl=pf
420 ll=pl*lp + 1
440 rem fetch & print the lines
450 open 2, 8, 2, f$
470 open 4, dv, sa
490 lc=0
500 lm=1: cr=0
520 for i = fl to ll
540 print# 15, "p" + chr$(2) + chr$(i and 255) + chr$(i/256) + chr$(1)
550 sys ad
560 l=peek(142)
580 if l then lm=1-lm: cr=0: goto 630
600 cr=cr+1: if cr<3 or lm goto 710
610 lm=1: goto 670
630 if l=1 and left$(a$,l)=chr$(32) then lm=1
650 print#4, left$(a$,l);
670 if lm then print#4: lc=lc+1
690 if lc>pp-7 then lc=0: for j=1 to 6: print#4: next
710 get z$: if z$="" goto 780
730 print: print "[208]ress 'q' to quit, other to resume:[146] ?[157]";
740 get z$: if z$="" goto 740
750 if z$="q" then print "[209]uit";: i=ll
760 print
780 next
800 close 2
810 for i=1 to pp-lc: print#4: next
820 close4
830 end
899 rem issue file name
900 data "jul86"
999 rem read & store ml
1000 ck=0: for i=ad to ad+41: read da: poke i,da: ck=ck+da: next
1010 if ck<>6121 then print "error in data": stop
1030 return
1050 rem c64 string thing data (file 2)
1060 data 160,2,177,45,153,137,0,200,192,6,208,246,162,2
1070 data 32,198,255,32,228,255,201,13,240,15,164,142,145,140
1080 data 200,132,142,196,139,240,4,165,144,240,234,76,204,255